#include<stdio.h>
int main()
{
	int time0 = 0;
	int pass = 0;
	scanf("%d %d",&time0,&pass);
	int h1 = time0/100;
	int m1 = time0%100;
	int time = h1*60+m1+pass;
	int h2 = time/60;
	int m2= time - h2*60;
	printf("%d%02d",h2,m2);
	return 0;
}
//{
//	int t, delta;
//	scanf("%d %d", &t, &delta);
//	int hour = t / 100;
//	int minute = t % 100;
//	int total = hour * 60 + minute + delta;
//	total %= 1440;
//	//if (total < 0) total += 1440;
//	hour = total / 60;
//	minute = total % 60;
//	printf("%d%02d\n", hour, minute);
//	return 0;
//}
